/* 
 *  Created By: Mike Stevens
 *  Project URL: http://www.codeplex.com/sitesecuritymgmt
 *  License: GNU GPL v2
 *  Copyright (C) 2008 Mike Stevens
 * 
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 */
using System;
using Microsoft.SharePoint;

namespace SiteSecurityManagement.Entities.SharePoint
{
    public class SPFileObject
    {
        #region Members
        
        #endregion

        #region Constructor/Destructor
        /// <summary>
        /// private constructor
        /// </summary>
        private SPFileObject()
        { }
        #endregion

        #region Properties

        #endregion

        #region Methods
        /// <summary>
        /// Gets the file.
        /// </summary>
        /// <param name="list">The list.</param>
        /// <param name="listItemID">The list item ID.</param>
        /// <returns></returns>
        public static SPFile GetFile(SPList list, Guid listItemID)
        {
            return list.Items[listItemID].File;
        }

        /// <summary>
        /// Gets the file.
        /// </summary>
        /// <param name="folder">The folder.</param>
        /// <param name="fileID">The file ID.</param>
        /// <returns></returns>
        public static SPFile GetFile(SPFolder folder, Guid fileID)
        {
            SPList list = SPListObject.GetList(folder.ParentWeb, folder.ParentListId);
            return SPFileObject.GetFile(list, fileID);
        }
        #endregion
    }
}
